Bin=http_server
Src=main.cc
CC=g++
FLAGS=-std=c++11 -lpthread

.PHONY:ALL
ALL:$(Bin) CGI

$(Bin):$(Src)
	$(CC) -o $@ $^ $(FLAGS)
CGI:
	cd ./cgi;make;cd -;

.PHONY:clean
clean:
	rm -f $(Bin) 
	rm -rf output
	cd ./cgi;make clean;cd -;

.PHONY:output
output:
	mkdir output
	cp $(Bin) output
	mv ./cgi/test_cgi wwwroot
	mv ./cgi/mysql_cgi wwwroot
	cp -rf wwwroot output